<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue事件使用</title>


</head>
<body>
<div id="app" class="aa">
    <h2>{{age}}</h2>
    <input type="button" value="事件传值" @click="changeage(23,'xiaochen')">
</div>

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    const app = new Vue({
        el: '#app',
        data:{
            age:20
        },
        methods: {
            changeage(age) {
                this.age = age;
            },
        }

    });
</script>
</body>
</html>